#include <iostream>
#include <vector>

using namespace std;

unsigned fuck(uint64_t num) {
    unsigned r = 1;
    unsigned p = 1;
    for (auto i = 2; i * i < num; ++i) {
        p = 1;
        while (num % i == 0) {
            ++p;
            num /= i;
        }
        r *= p;
    }
    return num > 1 ? 2 * r : r;
}

int main() {
    for (auto a = 1, i = 2; a += i; ++i) {
        if (fuck(a) > 500) {
            cout << a << endl;
            break;
        }
    }
}